<template>
  <div>
    <trade_custom_fh ref="trade_custom_fh" :parent="this"></trade_custom_fh>
    <div style="text-align:center">
      <el-button type="success" @click="submitForm('form')" size="mini">提交</el-button>
      <el-button type="info" @click="resetForm('form')" size="mini">重置</el-button>
    </div>
  </div>
</template>
<script>
  import * as kk from '@/utils/k-utils'
  import trade_custom_fh from '@/views/page/M8/public/trade_custom_fh'
  export default {
    data() {
      return {
      };
    },
    methods: {
      //提交交易
      submitForm(formName) {
        let params=this.$refs.trade_custom_fh.getFormParams("form");
        if(!params){
          this.$message.error("请输入必填项！！！");
        }else{
          params.dealtype = '45';//交易类型
          params.direction = '1';//交易方向
          params.grossamount = params.faceamount;//结算金额
          params.valuedate = params.tradedate;//交易日期
          params.cuy = "CNY";//币种
          kk.k_load_url("custom","/tradeSave/custom_save_trade_info.json",params).then(rep=>{
            kk.tradeSubmitFnc(rep,this.resetForm,params);
          });
        }
      },
      //重置表单
      resetForm(params) {
        this.$refs.trade_custom_fh.resetForm("form");
      }
    },
    components:{
      trade_custom_fh
    }
  }
</script>

<style scoped>
</style>
